<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    求任意一天  

    <script>
        function getTotalday(str) {
            var myDate = new Date(str);
            var total = 0;
            var month = myDate.getMonth();  
            var monthArr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
            //不能取到month
            for (var i = 0; i < month; i++) {
                total += monthArr[i];
            }
            var day = myDate.getDate();
            total = total + day;
            var year = myDate.getFullYear()
        }












    </script>





</body>
</html>